function logout()
{
	Ext.Ajax.request({
		url : 'client/logout' , 
		method: 'GET',
		failure: function(){location.reload(true);}
	});
}

function updateStyle()
{
	Ext.Ajax.request({
		url : 'client/updateStyle',
		params : { styleName : combo.getValue() },
		method: 'GET',
		failure: function(){location.reload(true);},
		success: function(){location.reload(true);}
	});
}

function sendTextMessage()
{
	var message = document.getElementById("textInputBox").value;
	var receiver = messageTabs.getActiveTab().title;
	if (getContactListIndex(receiver) == -1) return;
	Ext.Ajax.request({
		url : 'client/sendTextMessage',
		params : { message : message, receiver : receiver },
		method: 'GET'
	});
}

function getMessages()
{
	Ext.Ajax.request({
		url : 'client/getMessages' , 
		method: 'GET',
		success: messageHandler 
	});
}

function extendContact()
{
	var newUser = document.getElementById("extensionUserNameField").value;
	Ext.Ajax.request({
		url : 'client/extendContact',
		params : { newUser: newUser },
		method: 'GET'
	});
}

function reduceContact()
{
	if (!contactGrid.getSelectionModel().hasSelection())
	{
		Ext.Msg.alert("Fehler", "Bitte wählen Sie in der Kontaktliste jemanden aus!");
		return;
	}
	var userToRemove = contactList[contactGrid.getSelectionModel().last][NAME];
	Ext.Ajax.request({
		url : 'client/reduceContact',
		params : { userToRemove: userToRemove },
		method: 'GET'
	});
}